package com.cy.store.controller;

import com.cy.store.entity.DictDistrict;
import com.cy.store.service.impl.DictDistrictService;
import com.cy.store.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/districts/")
public class DictDistrictController extends BaseController{
    @Autowired
    private DictDistrictService dictDistrictService;

    @RequestMapping("list")
    public JsonResult<List<DictDistrict>> getDistricts(){
        List<DictDistrict> districtList = dictDistrictService.getAllDistrict();
        return new JsonResult<>(OK,districtList);
    }

}
